package sneuro;

public class Main {

    public static void main(String[] args) {
       Neuronet xn = new SNeuro(20, 4);
       double [][] tinputs = {
         {
           1,1,1,0,
           1,0,0,1,
           1,1,1,1,
           1,0,0,1,
           1,1,1,1
         },
         {
           0,1,1,0,
           1,0,0,1,
           1,0,0,1,
           1,1,1,1,
           1,0,0,1
         },
         {
           1,1,1,1,
           1,0,0,1,
           1,1,1,1,
           1,0,0,0,
           1,0,0,0
         },
         {
           1,1,1,0,
           1,0,0,1,
           1,0,0,1,
           1,0,0,1,
           1,1,1,1
         }
       };
       String [] resultl = {"D", "P", "A", "B"};
       int [][] tresults = {{0,0,0,1},{0,0,1,0},{0,1,0,0},{1,0,0,0}};       
       Nstatus status = xn.train(new TrainData(tinputs, tresults));
       puts ("Status: "+status.getStatus());
       puts ("Duration: "+status.getDuration());
       puts ("Message: " + status.getMessage());
       double [] test1 = {
           0,1,1,0,
           1,0,0,1,
           1,0,0,1,
           1,1,0,1,
           1,0,0,1
       };
       int [] test1r = xn.result(test1);
       for (int i=0; i<test1r.length; i++ ){
        if (test1r[i] == 1) puts (resultl[i]);
       }
    }
    
    public static void puts (Object o) {
      System.out.println(o);
    }

}
